const mysql=require('mysql')

const pool=mysql.createPool({
    host:'localhost',
    user:'root',
    password:'root',
    database:'1906adata',
    post:3306
})

function exec(sql){
    return new Promise((resolve,reject)=>{
        pool.query(sql,(err,data)=>{
            if(err){
                reject(err)
            }else{
                resolve(data)
            }
        })
    })
}

module.exports={exec}